//
//  String2Class.hpp
//  Practice12
//
//  Created by 赵世杰 on 2020/8/2.
//  Copyright © 2020 zhaoshijie. All rights reserved.
//

#ifndef String2Class_hpp
#define String2Class_hpp

#include <stdio.h>
#include <iostream>

#endif /* String2Class_hpp */


using namespace std;


class String2
{
    
private:
    char * str;
    int len;
    static int num_strings;
    static const int CINLIM = 80;

public:
    String2(const char *s);
    String2();
    String2(const String2 &st);
    ~String2();
    int length() const {return len;}
    String2 & operator=(const String2 &st);
    String2 & operator=(const char *s);
    char & operator[](int i);
    const char & operator[](int i) const;
    
    friend bool operator<(const String2 &st1,const String2 &st2);
    friend bool operator>(const String2 &st1,const String2 &st2);
    friend bool operator==(const String2 &st1,const String2 &st2);
    
    
    friend String2 operator+(const char *s,const String2 &st1);
    
    friend ostream & operator<<(ostream &os,const String2 &st);
    friend istream & operator>>(istream &is,String2 &st);
    
    
    static int HowMany();
    
    
    String2 & operator+(const String2 &st);
    void Stringlow();
    void Stringbig();
    int StringInCharCount(char c);
    
    
};


